package com.zhiyun.trace;

import android.app.Activity;
import android.content.Context;

import com.gzit.activity.GzitActivity;
import com.gzit.common.Action.Mapper;
import com.umeng.analytics.MobclickAgent;

/**
 * 通过友盟或者flurry统计的基础类 避免应用依赖于特定的统计工具，抽离出来
 * 
 * @author teddy
 * 
 */
public abstract class TraceActivity extends GzitActivity {

	@Override
	protected void onResume() {
		super.onResume();
		MobclickAgent.onResume(this);
	}

	@Override
	protected void onPause() {
		super.onPause();
		MobclickAgent.onPause(this);
	}

	protected void trace(String event_id, String label) {
		traceEvent(this, event_id, label);
	}

	protected void trace(String event_id) {
		MobclickAgent.onEvent(this, event_id);
	}

	public static void traceActivityrResume(Activity context) {
		MobclickAgent.onResume(context);

	}

	public static void traceActivityrPause(Activity context) {
		MobclickAgent.onPause(context);

	}

	public static void traceEvent(Activity context, String event_id) {
		MobclickAgent.onEvent(context, event_id);
	}

	public static void traceEvent(Activity context, String event_id,
			String label) {
		MobclickAgent.onEvent(context, event_id, label);
	}

	public static void traceEvent(Context context, String event_id) {
		MobclickAgent.onEvent(context, event_id);
	}

	public static void traceEvent(Context context, String event_id, String label) {
		MobclickAgent.onEvent(context, event_id, label);
	}

	@Override
	protected void regActions(Mapper arg0) {

	}

}
